﻿//---------------------------------------------------------------------------------
// Copyright 2011 Microsoft Corporation
// Licensed under the Microsoft Public License (MS-PL) (the "License"); 
// You may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.opensource.org/licenses/ms-pl.html
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR 
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, 
// INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR 
// CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
// MERCHANTABLITY OR NON-INFRINGEMENT. 
// See the Microsoft Public License (MS-PL) for the specific language governing 
// permissions and limitations under the License.
//---------------------------------------------------------------------------------
namespace Microsoft.Telco.Web.Services.ServiceModel
{
    /// <summary>
    /// Helper class for generating array objects.  This is another WCF class that we needed to re-create to modify some default WCF behavior.
    /// </summary>
    internal class EmptyArray
    {
        // Fields
        private static object[] instance = new object[0];

        // Methods
        private EmptyArray()
        {
        }

        internal static object[] Allocate(int n)
        {
            if (n == 0)
            {
                return Instance;
            }
            return new object[n];
        }

        // Properties
        internal static object[] Instance
        {
            get
            {
                return instance;
            }
        }
    }

}
